package Entity;

import java.io.File;
import java.io.Serializable;
import java.util.Vector;

public class Book implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	private String ISBN;
	private String BookName;
	private String BookAuthor;
	private String BookSubject;
	private String BookSubjectID;
	private String Edition;
	private String Description;
	private String ShelfLocation;
	private String PublishYear;
	private String Wanted;
	private int BookNumOfCopies;
	private int BookTotalNumOfCopies;
	private int NumOfOrdersForBook;
	private byte [] TOCofBook ; 


	public Book() 
	{
		ISBN = ("");
		BookName = ("");
		BookAuthor = ("");
		BookSubject = ("");
		BookSubjectID = ("");
		Edition = ("");
		Description =("");
		ShelfLocation = ("");
		PublishYear = ("");
		Wanted = ("");
		BookNumOfCopies = -10;
		BookTotalNumOfCopies = -10;
		NumOfOrdersForBook = -10;
		TOCofBook = null;
		
	}

	public Book(String iSBN)
	{
		this.ISBN = iSBN;
	}
	
	public Book(String iSBN, String bookName, String bookAuthor,String bookSubject, String bookSubjectID, String additionNum,
			String description, String shelfLocation,String printYear, int bookNumOfCopies,int bookTotalNumOfCopies ,String wanted) 
	{
		ISBN = iSBN;
		BookName = bookName;
		BookAuthor = bookAuthor;
		BookSubject = bookSubject;
		BookSubjectID = bookSubjectID;
		Edition = additionNum;
		Description = description;
		ShelfLocation = shelfLocation;
		PublishYear = printYear;
		BookNumOfCopies = bookNumOfCopies;
		BookTotalNumOfCopies = bookTotalNumOfCopies ;
		Wanted = wanted;
		
	}

	public Book(String iSBN, String bookName, String bookAuthor,String editionNum,String publishYear,String description, String shelfLocation,String wanted) 		
	{
		ISBN = iSBN;
		BookName = bookName;
		BookAuthor = bookAuthor;
		Edition = editionNum;
		PublishYear=publishYear;
		Description = description;
		ShelfLocation = shelfLocation;
		Wanted = wanted;
		
	}
	
	
//===================================================================	
//             Getters & Setters
//===================================================================
	
	public String getISBN()
	{
		return ISBN;
	}
	public void setISBN(String iSBN) 
	{  
		
		  ISBN = iSBN;
	}
	public String getBookName() 
	{
		return BookName;
	}

	public void setBookName(String bookName) 
	{
		if(!bookName.isEmpty())
			BookName = bookName;
	}

	public String getBookAuthor() 
	{
		return BookAuthor;
	}

	public void setBookAuthor(String bookAuthor) 
	{
		if(!bookAuthor.isEmpty())
		  BookAuthor = bookAuthor;
	}

	public String getBookSubject() 
	{
		return BookSubject;
	}

	public void setBookSubject(String bookSubject)
	{
		if(bookSubject != null)
		  BookSubject = bookSubject;
	}

	public String getBookSubjectID()
	{
		return BookSubjectID;
	}

	public void setBookSubjectID(String bookSubjectID) 
	{
		if(!bookSubjectID.isEmpty())
		  BookSubjectID = bookSubjectID;
	}

	public String getEdition() 
	{
		return Edition;
	}

	public void setEdition(String editionNum) 
	{
		if(!editionNum.isEmpty())
		 Edition = editionNum;
	}

	public String getDescription()
	{
		return Description;
	}

	public void setDescription(String description)
	{
		if(!description.isEmpty())
		 Description = description;
	}

	public String getShelfLocation()
	{
		return ShelfLocation;
	}

	public void setShelfLocation(String shelfLocation) 
	{
		if(!shelfLocation.isEmpty())
		 ShelfLocation = shelfLocation;
	}


	public String getPublishYear() 
	{
		return PublishYear;
	}

	public void setPublishYear(String printYear) 
	{
		if(!printYear.isEmpty())
		 PublishYear = printYear;
	}


	public int getBookNumOfCopies() 
	{
		return BookNumOfCopies;
	}

	public void setBookNumOfCopies(int bookNumOfCopies) 
	{
		if(bookNumOfCopies >= 0)
		  BookNumOfCopies = bookNumOfCopies;
	}

	public String getWanted() 
	{
		return Wanted;
	}

	public void setWanted(String wanted) 
	{
		Wanted = wanted;
	}
	
	public int getBookTotalNumOfCopies()
	{
		return BookTotalNumOfCopies;
	}


	public void setBookTotalNumOfCopies(int bookTotalNumOfCopies) 
	{
		BookTotalNumOfCopies = bookTotalNumOfCopies;
	}


	public int getNumOfOrdersForBook() 
	{
		return NumOfOrdersForBook;
	}


	public void setNumOfOrdersForBook(int numOfOrdersForBook)
	{
		NumOfOrdersForBook = numOfOrdersForBook;
	}

	public byte [] getTOCofBook() 
	{
		return this.TOCofBook;
	}

	public void setTOCofBook( byte [] tOCofBook) 
	{
		this.TOCofBook = new  byte[tOCofBook.length];
		
		for(int i = 0; i < tOCofBook.length ; i++)
			TOCofBook[i] =  tOCofBook[i];
	}
	

	
	
	
}//class
